package pya;

import java.util.Scanner;

class Person{
	private String name;
	private boolean gender;
	private int age;
	private int id;
	private static int Id;
	public Person(){
		System.out.println("This is constructor");
		System.out.println(this.name+","+this.age+","+this.gender+","+this.id);
	}
	public Person(String name,boolean gender,int age){
		this.name=name;
		this.gender=gender;
		this.age=age;
	}
	public String toString(){
		return("Person "+"[name="+name+", age="+age+", gender="+gender+", id="+id+"]");
	}
	static{
		System.out.println("This is static initialization block");
	}
	{
		id=Id;
		Id++;
		System.out.println("This is initialization block, id is "+this.id);
	}
}

public class Main {

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		int Num=input.nextInt();
		Person[] person=new Person[Num];
		for (int i = 0; i <Num; i++) {
			String name=input.next();
			int age=input.nextInt();
			boolean gender=input.nextBoolean();
			person[i]=new Person(name,gender,age);
		}
		for (int i = person.length - 1; i >= 0; i--) {
			System.out.println(person[i]);
		}
		Person people=new Person();
		System.out.println(people);
		
	}
}